<%@ Page Language="C#" Culture="en-GB" UICulture="en-GB" MasterPageFile="~/WebMaster.master" Theme="DefaultSkin"
    AutoEventWireup="true" Inherits="_Default" Title="Untitled Page" Codebehind="Default.aspx.cs" %>

<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:LoginView ID="LoginView1" runat="server">
        <LoggedInTemplate>
            <asp:Label ID="Label1" runat="server" CssClass="infoLabel" Text="Hello"></asp:Label>
            <asp:LoginName ID="LoginName1" runat="server" CssClass="userName" />
            <asp:Label ID="Label2" runat="server" CssClass="infoLabel" Text=", here are the meters currently registered to you"/>
            <p>
                <asp:GridView ID="lstUserMeters" runat="server" AutoGenerateColumns="False" CellPadding="4" GridLines="None">
                    <RowStyle CssClass="tableRow" />
                    <Columns>
                        <asp:HyperLinkField DataNavigateUrlFields="MeterId" 
                            DataNavigateUrlFormatString="~/meter/MeterSummary.aspx?MeterId={0}" 
                            DataTextField="MeterName" HeaderText="Meter" />
                        <asp:BoundField DataField="Days" HeaderText="Days" />
                        <asp:BoundField DataField="TotalKWh" HeaderText="Total kWh" />
                        <asp:BoundField DataField="Average" HeaderText="Average kWh" />
                   <asp:HyperLinkField DataNavigateUrlFields="MeterId" 
                            DataNavigateUrlFormatString="~/manual/EnergyEntry_electricity.aspx?meterId={0}" 
                            Text="Add new reading" />
                             </Columns>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <EmptyDataTemplate ><p>You do not appear to have any manual reading electricity meters.
                    Why not <a href="meter/AddNewManual.aspx">create</a> one?</p></EmptyDataTemplate>
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle  CssClass="tableHeader" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle  CssClass="tableAltRow" />
                </asp:GridView>
            </p>
        </LoggedInTemplate>
        <AnonymousTemplate>
            Welcome to Communergy, enabling you to record and monitor your personal energy use. Please <asp:LoginStatus ID="LoginStatus1" runat="server" /> or <a href="membership/register.aspx">register</a> to get started.<br /><br />
            Alernatively, visit the project home at <a href="http://communergy.codeplex.com/">communergy.codeplex.com</a>
        </AnonymousTemplate>
    </asp:LoginView>
    
    <div class="vsep"></div>
    
    <asp:CHART ID="chartRange" runat="server" ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)">
        <legends>
            <asp:Legend Enabled="False" Name="Default" Docking="Right"/>
        </legends>
        <Titles>
            <asp:Title Name="mainTitle" Visible="True" Font="Verdana, 10pt, style=bold" ForeColor="White" />
            <asp:Title Name="userTitle" Visible="False" Font="Verdana, 8pt, style=bold" ForeColor="White"/>
        </Titles>
        <Series>
            <asp:Series ChartType="RangeColumn" Name="Default" YValuesPerPoint="2" XValueType="DateTime" 
                ShadowOffset="3" Color="Red"/>
        </Series>
        <chartareas>
            <asp:ChartArea BackColor="Transparent" Name="ChartArea1">
                <AxisX LineColor="Orange" LabelAutoFitStyle="None" TitleForeColor="White" Title="Date">
                    <LabelStyle Enabled="true" ForeColor="White" Font="Verdana, 8pt" Angle="-30" Interval="2" Format="dd.MM"/>
                    <MajorGrid LineWidth="1" LineColor="#999999" />
                    <MajorTickMark Enabled="true" LineColor="Orange" />
                </AxisX>
                
                <AxisY LineColor="Orange" LabelAutoFitStyle="None" TitleForeColor="White" Title="kWh">
                    <LabelStyle Enabled="true" ForeColor="White" Font="Verdana, 8pt" />
                    <MajorGrid LineWidth="1" LineColor="#999999" />
                    <MajorTickMark Enabled="true" LineColor="Orange" />
                </AxisY>
                
            </asp:ChartArea>
        </chartareas>
    </asp:CHART>

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="True">
    </asp:ScriptManager>
</asp:Content>
